package com.zbkj.business;

import com.tiangong.framework.bo.CDO;
import com.tiangong.framework.bo.ITemporalReturn;

/**
 * 返回码和说明枚举类
 */
//TODO 状态码5000-5999
public enum ReturnEnum implements ITemporalReturn {
    //系统
    SUCCESS                                                                 (0  ,"成功"),
    LOGIN_ADMIN_LOGIN_TIMEOUT                                               (103  ,"登录超时，请重新登录"),
    SYSTEM_PHONECODE                                                        (104  ,"短信发送频繁，请稍后再试"),
    LOGIN_PHONECODE_ERROR                                                   (105  ,"验证码错误"),

    //业务相关

    LOGIN_ADMIN_NOT_EXIST                                                   (1001  ,"当前用户不存在"),
    LOGIN_ADMIN_AUTH_FAIL                                                   (1002  ,"用户名或密码不正确"),

    LOGIN_ADMIN_AUTH_LOCK                                                   (1003  ,"当前用户已被冻结"),
    LOGIN_ADMIN_AUTH_NOT_ENABLE                                             (1004  ,"当前用户已被限制登录"),

    LOGIN_ADMIN_PHONE_EXIST                                                 (1005  ,"当前手机号已被注册，请更换后重试"),
    LOGIN_ADMIN_LOGINNAME_EXIST                                             (1006  ,"当前用户名或手机号已被注册，请更换后重试"),
    LOGIN_ADMIN_PASSWORD_ERROR                                              (1007  ,"原始密码输入有误"),

    //补充
    DEFINED                                                                 (9999  ,"系统开小差了，请稍后再试");

    private int code;
    private String msg;
    private Boolean success;
    private CDO data;

    ReturnEnum(int code, String msg, Boolean success) {
        this.code = code;
        this.msg = msg;
        this.success = success;
    }
    ReturnEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
        this.success = false;
    }

    @Override
    public int getCode() {
        return this.code;
    }

    @Override
    public String getMsg() {
        return this.msg;
    }

    @Override
    public CDO getData() {
        return new CDO();
    }

    @Override
    public Boolean isSuccess() {
        return this.success;
    }
}
